package com.ziytek.web.citizen.virtual;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

/**
 * 线程池
 *
 * @author fenghx
 */
@Lazy
@Slf4j
public class VirtualThreadPool {

    private static final Executor EXECUTOR = Executors.newVirtualThreadPerTaskExecutor();

    public static void execute(Runnable runnable) {
        EXECUTOR.execute(runnable);
    }

}